<?php
class UserGradeLog extends EMongoDocument // Notice: We extend EMongoDocument class instead of CActiveRecord
{
    public $event;
    public $createtime;
    public $grade;
    public $userid;
    public $eventObject;

    /**
     * This method have to be defined in every Model
     * @return string MongoDB collection name, witch will be used to store documents of this model
     */
    public function getCollectionName()
    {
        return 'user_grade_log';
    }
 
    // We can define rules for fields, just like in normal CModel/CActiveRecord classes
    public function rules()
    {
        return array(
            // array('login, email, personal_no', 'required'),
            // //array('personal_no', 'numeric', 'integerOnly' => true),
            // array('email', 'email'),
        );
    }

    // the same with attribute names
    public function attributeNames()
    {
        return array(
            'event' => 'event',
            'createtime'=>'createtime',
            'grade'=>'grade',
            'userid'=>'userid',
            'eventObject'=>'eventObject',
            '_id'=>"_id",
        );
    }
 
    /**
     * This method have to be defined in every model, like with normal CActiveRecord
     */
    public static function model($className=__CLASS__)
    {
        return parent::model($className);
    }
}